package com.app.utils.impl.labour;

import com.app.utils.impl.IConsole;
import com.app.utils.impl.Strategy;
import com.zndroid.utils.XUtils;
import com.zndroid.utils.impl.AppUtil;

/**
 * Created by lzy on 2022/2/15.
 */
public class AppUtilStrategy extends Strategy {
    public AppUtilStrategy(IConsole iConsole) {
        super(iConsole);
    }

    @Override
    public void doing() {
        AppUtil util = XUtils.create().appUtil();
        iConsole.console("getAppName", util.getAppName(XUtils.getContext()));
        iConsole.console("getPackageName", util.getPackageName(XUtils.getContext()));
        iConsole.console("getPackageName(local apk【ex:华为系统某个自带的应用】)", util.getPackageName(XUtils.getContext(), "/system/app/HMS/HMS.apk"));
        iConsole.console("getVersionName", util.getVersionName(XUtils.getContext()));
        iConsole.console("getVersionName(local apk【ex:华为系统某个自带的应用】)", util.getVersionName(XUtils.getContext(), "/system/app/HMS/HMS.apk"));
        iConsole.console("getVersionCode", util.getVersionCode(XUtils.getContext()) + "");
        iConsole.console("getVersionCode(local apk【ex:华为系统某个自带的应用】)", util.getVersionCode(XUtils.getContext(), "/system/app/HMS/HMS.apk") + "");
        iConsole.console("getAppMetaData(AppKey)", util.getAppMetaData(XUtils.getContext()).getString("AppKey"));
        iConsole.console("getFirstInstallTime", util.getFirstInstallTime(XUtils.getContext()) + "");
        iConsole.console("getLastUpdateTime", util.getLastUpdateTime(XUtils.getContext()) + "");
        iConsole.console("isAppInstalled(com.eg.android.AlipayGphone【支付宝】)", util.isAppInstalled(XUtils.getContext(), "com.eg.android.AlipayGphone") + "");
        iConsole.console("getRingVolume", util.getRingVolume(XUtils.getContext()) + "");
        iConsole.console("installApk", "条件限制，暂不演示");
        iConsole.console("restartApp", "demo暂不演示");
    }
}
